/**
 * 
 */
package com.haizhi.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Service;

import com.haizhi.bean.TbFeed;
import com.haizhi.bean.TbUserActivity;
import com.haizhi.dao.UserActivityDao;
import com.haizhi.service.UserActivityService;

/**
 * @author jiangjintai
 *
 */
@Service("userActivityService")
public class UserActivityServiceImpl extends BaseServiceImpl<TbUserActivity, Integer> implements UserActivityService {

	@Autowired
	UserActivityDao userActivityDao;
	/* （非 Javadoc）
	 * @see com.haizhi.service.BaseService#findById(java.lang.Object)
	 */
	@Override
	public TbUserActivity findById(Integer id) {
		//
		return userActivityDao.findOne(id);
	}

	/* （非 Javadoc）
	 * @see com.haizhi.service.BaseService#save(java.lang.Object)
	 */
	@Override
	public TbUserActivity save(TbUserActivity entity) {

		return userActivityDao.save(entity);
	}

	/* （非 Javadoc）
	 * @see com.haizhi.service.BaseService#delete(java.lang.Object)
	 */
	@Override
	public void delete(TbUserActivity entity) {
		// 
		this.userActivityDao.delete(entity);

	}

	/* （非 Javadoc）
	 * @see com.haizhi.service.BaseService#findAll()
	 */
	@Override
	public List<TbUserActivity> findAll() {
		// 
		return this.userActivityDao.findAll();
	}

	/* （非 Javadoc）
	 * @see com.haizhi.service.UserActivityService#findByUserId(java.lang.Integer, org.springframework.data.domain.Pageable)
	 */
	@Override
	public Page<TbUserActivity> findByUserId(Integer userId, Pageable pageAble) {
		// 
		return userActivityDao.findByTbUserUserId(userId,pageAble);
	}

	/* （非 Javadoc）
	 * @see com.haizhi.service.impl.BaseServiceImpl#getDao()
	 */
	@Override
	protected JpaRepository<TbUserActivity, Integer> getDao() {
		//
		return this.userActivityDao;
	}

}
